<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/order/ingredientlist/IngredientListDetails.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/order/ingredientlist/IngredientListDetails.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '配料单明细',
                name: 'ingredientlist/IngredientListDetails',
                url: "/IngredientListDetails/",
                sortName: "IngredientsType,MaterialId",
                foreignKey:null
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'IngredientListId',title:'配料单号(id)',type:'string',width:110,hidden:true,align:'left'},
                       {field:'IngredientsType',title:'配料类型',type:'int',bind:{ key:'配料类型',data:[]},width:110,align:'left',sort:true},
                       {field:'MaterialId',title:'物料（产品）ID',type:'string',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'MaterialName',title:'物料（产品）名称',type:'string',bind:{ key:'物料列表',data:[]},width:110,align:'left'},
                       {field:'Source',title:'1=立库；2=配料台；3、配料备料',type:'string',bind:{ key:'配料来源',data:[]},width:110,align:'left'},
                       {field:'BatchNumber',title:'批次号',type:'string',width:110,align:'left'},
                       {field:'RequiredWeight',title:'需求重量',type:'string',width:110,readonly:true,align:'left'},
                       {field:'ActualWeight',title:'投料重量（实际）',type:'string',width:110,align:'left'},
                       {field:'State',title:'状态',type:'int',width:110,align:'left'},
                       {field:'MaterialBoxNo',title:'料箱号',type:'string',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
